package 多线程初阶.示例测试;
/**
 * currentThread()方法
 */
public class TestDemo9 {
    private static class MyRunnable implements Runnable{
        public  MyRunnable(){
            System.out.println(Thread.currentThread().getName()+" 调用了构造方法");
        }
        @Override
        public void run() {
            System.out.println(Thread.currentThread().getName()+" 调用了run方法");
        }
    }
    public static void main(String[] args) {
        MyRunnable myRunnable=new MyRunnable();
        Thread thread=new Thread(myRunnable);
        thread.start();
    }
}
